﻿<UserControl x:Class="EpiDashboard.Controls.GadgetHeaderPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             Height="26"
             d:DesignHeight="26" d:DesignWidth="330">
    <UserControl.Resources>
        
        <Style TargetType="TextBlock" x:Key="titleTextStyle">
            <Setter Property="Margin" Value="7,3,0,3" />
            <Setter Property="FontFamily" Value="Calibri, Global User Interface" />
            <Setter Property="FontWeight" Value="Regular" />
            <Setter Property="FontSize" Value="20" />
            <Setter Property="Foreground" Value="#5B82B5" />
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <!--<Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Foreground" Value="Yellow"/>                    
                </Trigger>
            </Style.Triggers>-->
        </Style>

        <LinearGradientBrush x:Key="brushRedOrange" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="OrangeRed" Offset="0" />
                    <GradientStop Color="DarkRed" Offset="1" />
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="brushWhiteTransparent" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="transparent" Offset="0" />
                    <GradientStop Color="#44ffffff" Offset="1" />
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="brushWhiteSnow" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="White" Offset="0" />
                    <GradientStop Color="Snow" Offset="1" />
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <Style x:Key="descRectangle" TargetType="Rectangle">
            <Setter Property="Fill" Value="SteelBlue"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="descRectangleHover" TargetType="Rectangle">
            <Setter Property="Fill" Value="LightBlue"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="filterRectangle" TargetType="Rectangle">
            <Setter Property="Fill" Value="CornflowerBlue"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="filterRectangleHover" TargetType="Rectangle">
            <Setter Property="Fill" Value="#9CBBF3"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="collapseRectangle" TargetType="Rectangle">
            <Setter Property="Fill" Value="ForestGreen"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="collapseRectangleHover" TargetType="Rectangle">
            <Setter Property="Fill" Value="LightGreen"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="closeRectangle" TargetType="Rectangle">
            <Setter Property="Fill" Value="{StaticResource brushRedOrange}"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>            
        </Style>

        <Style x:Key="closeRectangleHover" TargetType="Rectangle">
            <Setter Property="Fill" Value="PeachPuff"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="configRectangle" TargetType="Rectangle">
            <Setter Property="Fill" Value="SlateBlue"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="configRectangleHover" TargetType="Rectangle">
            <Setter Property="Fill" Value="LightSteelBlue"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="closeX" TargetType="Path">            
            <Setter Property="Stroke" Value="White"/>
        </Style>

        <Style x:Key="closeXHover" TargetType="Path">
            <Setter Property="Stroke" Value="Maroon"/>
        </Style>

        <Style x:Key="collapseTriangle" TargetType="Path">            
            <Setter Property="Data" Value="M 5 0 L 10 10 0 10 Z" />
        </Style>

        <Style x:Key="collapseTriangleHover" TargetType="Path">            
            <Setter Property="Data" Value="M 5 0 L 10 10 0 10 Z" />
        </Style>

        <Style x:Key="expandTriangle" TargetType="Path">            
            <Setter Property="Data" Value="M 5 10 L 0 0 10 0 Z" />
        </Style>

        <Style x:Key="expandTriangleHover" TargetType="Path">            
            <Setter Property="Data" Value="M 5 10 L 0 0 10 0 Z" />
        </Style>
        
    </UserControl.Resources>
    <Grid x:Name="gridHeader">
        <!--<Grid.Background>-->
            <!--<SolidColorBrush Color="#32475C"/>-->
            <!--<SolidColorBrush Color="White"/>-->
        <!--</Grid.Background>-->
        <!--<Grid.Background>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                <GradientStop Color="#C6D5E8" Offset="0.0" />
                <GradientStop Color="#6C9DC6" Offset="1.0" />
            </LinearGradientBrush>
        </Grid.Background>-->
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="30" />
            <ColumnDefinition Width="26" />
            <ColumnDefinition Width="26" />
            <ColumnDefinition Width="26" />
            <ColumnDefinition Width="26" />
            <ColumnDefinition Width="26" />
            <ColumnDefinition Width="4" />
        </Grid.ColumnDefinitions>
        <TextBlock x:Name="gadgetTypeText" Style="{StaticResource titleTextStyle}" Grid.Column="0" >Dashboard Gadget</TextBlock>

        <Grid Grid.Column="2" x:Name="grdCustomFilter" Width="20" Height="20" Margin="1" Visibility="Visible" VerticalAlignment="Bottom">
            <Rectangle x:Name="filterRectangle1" Style="{StaticResource filterRectangle}"/>
            <Rectangle Opacity="0.5" Stroke="Transparent" Margin="1"  MouseEnter="PathFilter_MouseEnter" MouseLeave="PathFilter_MouseLeave" MouseLeftButtonUp="PathFilter_MouseLeftButtonUp" >
                <Rectangle.ToolTip>
                    <ToolTip x:Name="toolTipDataFilters">Allows the use of custom gadget-specific data filters. Any data filters created for this gadget will be applied in addition to any canvas-wide filters.</ToolTip>
                </Rectangle.ToolTip>
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStopCollection>
                                <GradientStop Color="white" Offset="0" />
                                <GradientStop Color="transparent" Offset="1" />
                            </GradientStopCollection>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <!--<Path x:Name="pathTriangle" Style="{StaticResource collapseTriangle}" IsHitTestVisible="False" Stretch="Fill" Width="6.878" Height="6.878" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round"  />-->
            <Path x:Name="pathFilter" Data="M 5 5 L 0 -1 10 -1 Z" IsHitTestVisible="False" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="White" />
            <Line IsHitTestVisible="False"
    X1="10" Y1="9"
    X2="10" Y2="15"
    Stroke="White"
    StrokeThickness="2" />

            <!--M 5 10 L 0 0 10 0 Z    Expand arrow-->
            <!--M 5 0 L 10 10 0 10 Z   Collapse arrow -->
        </Grid>

        <Grid Grid.Column="3" x:Name="grdConfigure" Width="20" Height="20" Margin="1" Visibility="Visible"  VerticalAlignment="Bottom" >
            <Rectangle x:Name="configRectangle1" Style="{StaticResource configRectangle}"/>
            <Rectangle Opacity="0.5" Stroke="Transparent" Margin="1"  MouseEnter="PathConfig_MouseEnter" MouseLeave="PathConfig_MouseLeave" MouseLeftButtonUp="PathConfig_MouseLeftButtonUp" >
                <Rectangle.ToolTip>
                    <ToolTip x:Name="toolTipConfig">Opens the gadget configuration panel.</ToolTip>
                </Rectangle.ToolTip>
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStopCollection>
                                <GradientStop Color="white" Offset="0" />
                                <GradientStop Color="transparent" Offset="1" />
                            </GradientStopCollection>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <Ellipse IsHitTestVisible="False" Margin="4.5" Stroke="White" StrokeThickness="2"></Ellipse>
            <Line IsHitTestVisible="False"
    X1="2" Y1="10"
    X2="5" Y2="10"
    Stroke="White"
    StrokeThickness="2" />

            <Line IsHitTestVisible="False"
    X1="15" Y1="10"
    X2="18" Y2="10"
    Stroke="White"
    StrokeThickness="2" />

            <Line IsHitTestVisible="False"
    X1="10" Y1="2"
    X2="10" Y2="5"
    Stroke="White"
    StrokeThickness="2" />

            <Line IsHitTestVisible="False"
    X1="10" Y1="15"
    X2="10" Y2="18"
    Stroke="White"
    StrokeThickness="2" />

            <Line IsHitTestVisible="False"
    X1="4.5" Y1="4.5"
    X2="7" Y2="7"
    Stroke="White"
    StrokeThickness="2" />

            <Line IsHitTestVisible="False"
    X1="15.5" Y1="15.5"
    X2="13" Y2="13"
    Stroke="White"
    StrokeThickness="2" />

            <Line IsHitTestVisible="False"
    X1="13" Y1="7"
    X2="15.5" Y2="4.5"
    Stroke="White"
    StrokeThickness="2" />

            <Line IsHitTestVisible="False"
    X1="4.5" Y1="15.5"
    X2="7" Y2="13"
    Stroke="White"
    StrokeThickness="2" />


            <!--<Path x:Name="pathConfig" Style="{StaticResource collapseTriangle}" Data="M85,30 L85,30 L87.5,25 L90,30 z" IsHitTestVisible="False" Stretch="Fill" Width="6.878" Height="6.878" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round"  />-->
        </Grid>

        <Grid Grid.Column="4" x:Name="grdDescription" Width="20" Height="20" Margin="1" Visibility="Visible" VerticalAlignment="Bottom">
            <Rectangle x:Name="descRectangle1" Style="{StaticResource descRectangle}"/>
            <Rectangle Opacity="0.5" Stroke="Transparent" Margin="1" MouseEnter="PathDesc_MouseEnter" MouseLeave="PathDesc_MouseLeave" MouseLeftButtonUp="PathDesc_MouseLeftButtonUp">
                <Rectangle.ToolTip>
                    <ToolTip x:Name="toolTipDesc">Expands the description panel.</ToolTip>
                </Rectangle.ToolTip>
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStopCollection>
                                <GradientStop Color="white" Offset="0" />
                                <GradientStop Color="transparent" Offset="1" />
                            </GradientStopCollection>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>            
            <Line IsHitTestVisible="False"
    X1="4" Y1="5"
    X2="16" Y2="5"
    Stroke="White"
    StrokeThickness="2" />

            <Line IsHitTestVisible="False"
    X1="4" Y1="10"
    X2="16" Y2="10"
    Stroke="White"
    StrokeThickness="2" />

            <Line IsHitTestVisible="False"
    X1="4" Y1="15"
    X2="16" Y2="15"
    Stroke="White"
    StrokeThickness="2" />
        </Grid>

        <Grid Grid.Column="5" x:Name="grdExpandCollapse" Width="20" Height="20" Margin="1" Visibility="Visible"  VerticalAlignment="Bottom">
            <Rectangle x:Name="expandCollapseRectangle1" Style="{StaticResource collapseRectangle}"/>
            <Rectangle Opacity="0.5" Stroke="Transparent" Margin="1"  MouseEnter="PathCollapse_MouseEnter" MouseLeave="PathCollapse_MouseLeave" MouseLeftButtonUp="PathCollapse_MouseLeftButtonUp" >
                <Rectangle.ToolTip>
                    <ToolTip x:Name="toolTipCollapseOutput">Collapses or expands the gadget's output.</ToolTip>
                </Rectangle.ToolTip>
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStopCollection>
                                <GradientStop Color="white" Offset="0" />
                                <GradientStop Color="transparent" Offset="1" />
                            </GradientStopCollection>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <!--<Path x:Name="pathTriangle" Style="{StaticResource collapseTriangle}" IsHitTestVisible="False" Stretch="Fill" Width="6.878" Height="6.878" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round"  />-->
            <Path x:Name="pathTriangle" Style="{StaticResource collapseTriangle}" IsHitTestVisible="False" HorizontalAlignment="Center" VerticalAlignment="Center"
          StrokeLineJoin="Round"           
          Fill="White">
            </Path>

            <!--M 5 10 L 0 0 10 0 Z    Expand arrow-->
            <!--M 5 0 L 10 10 0 10 Z   Collapse arrow -->
        </Grid>

        <Grid Grid.Column="6" x:Name="grdErrorIcon" Width="20" Height="20" Margin="1" Visibility="Visible" VerticalAlignment="Bottom">
            <Rectangle x:Name="closeRectangle1" Style="{StaticResource closeRectangle}" />
            <Rectangle Opacity="0.5" Stroke="Transparent" Margin="1"  MouseEnter="PathX_MouseEnter" MouseLeave="PathX_MouseLeave" MouseLeftButtonUp="PathX_MouseLeftButtonUp" >
                <Rectangle.ToolTip>
                    <ToolTip x:Name="toolTipClose">Closes the gadget.</ToolTip>
                </Rectangle.ToolTip>
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStopCollection>
                                <GradientStop Color="white" Offset="0" />
                                <GradientStop Color="transparent" Offset="1" />
                            </GradientStopCollection>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <Path x:Name="pathX" Style="{StaticResource closeX}" IsHitTestVisible="False" Stretch="Fill" Width="6.878" Height="6.878" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Data="M 200,0 L 0,200 M 0,0 L 200,200"/>
        </Grid>
    </Grid>
</UserControl>
